<?php

namespace app\index\controller;

use app\common\controller\Frontend;
use think\DB;

class Home extends Frontend
{

    protected $noNeedLogin = '*';
    protected $noNeedRight = '*';
    protected $layout = '';

    public function index()
    {
        return $this->view->fetch();
    }

    public function grade()
    {
        $grades =
            [
                'id_card' => '142703199807168824',
                'name' => 'xxx',
                'grade' => '100',
            ];
        $this->view->assign('grades', $grades);
        return $this->view->fetch();
    }

    public function download()
    {
        // 获取cookie下的account
        $account = $this->request->cookie('account');
        $pdf = 'test.pdf';
        // $address = $account和$pdf拼接的地址
        $address = $account . '/' . $pdf;
        $this->view->assign('address', $address);
        return $this->view->fetch();
    }
}
